﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common
{
    #region clientItem
    /// <summary>
    /// 主机项状态
    /// </summary>
    public enum ClientItemState
    {
        idle=0,     //等待
        busy=1,     //繁忙
    }

    /// <summary>
    /// 主机项数据
    /// </summary>
    public class ClientItemData
    {
        public string ipEndPoint; //虚拟机连接方式获取的ip 和 remoteIPEndpoint 不一样
        public ClientItemState clientItemState;
        public int taskCount;       //当前分配任务数

        public ClientItemData(string ipEndPoint,ClientItemState itemState,int taskCount)
        {
            this.ipEndPoint = ipEndPoint;//以服务端获取的ip为准
            this.clientItemState = itemState;
            this.taskCount = taskCount;
        }
    }
    #endregion

    #region TaskItem
    public enum TaskItemState
    {
        idle = 0,     //等待
        busy = 1,     //繁忙
        complete = 3, //完成
    }

    /// <summary>
    /// 列表项数据
    /// </summary>
    public class TaskItemData
    {
        public TaskItemData(string importpath,string exportpath, TaskItemState state)
        {
            this.md5key = Common.MD5Hash.GetstrMD5(importpath);
            this.importpath = importpath;
            this.exportpath = exportpath;
            this.taskItemState = state;
        }

        public string md5key;
        public string importpath;
        public string exportpath;
        public TaskItemState taskItemState;
        public int taskCount;
        public string ipEndPoint;
        public string machineName;
        public List<string> commands;

        override
        public string ToString()
        {
            return this.importpath + this.machineName+taskCount;
        }
    }
    #endregion

    #region CommandsItem
    public class CommandsItemData
    {
        public bool selected = false;
        public string commands;
        public string info;
    }
    #endregion
}
